{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
    <div class="main">
        <!-- left side start-->
        {include admin.inc.menu}
        <!-- left side end-->


        <!-- main content start-->
        <section class="right-section" id="right-section">
            <!-- start of inner-frame -->
            <div class="inner-iframe">

                <!-- page breadcrumb start-->
                {include admin.inc.bread}
                <!-- page "breadcrumb end-->
                <!-- Nav tabs -->
                <ul class="nav nav-tabs">

                    <li {if $id==''}class="active"{/if}><a {if
                                                           $id==''}href="javascript:void(0);"{else}href="{$add_url}"{/if}><i
                            class="glyphicon glyphicon-plus"></i> 商品发布</a></li>
                    <li><a href="indexBySale.shtml"><i class="glyphicon glyphicon-th-list"></i> 出售中的商品</a></li>
                    <li><a href="indexByStore.shtml"><i class="glyphicon glyphicon-th-list"></i> 仓库中的商品</a></li>


                </ul>
                <div class="inner-container">
                    <form role="form" class="form-horizontal basicForm content-add-form" id="content-add-form"
                          autocomplete="off"  action="{$do_edit_url}?id={$id}" onsubmit="return false">
                        <h4>交易信息</h4>
                        <div id="fourLinkage"
                             style="border-top:1px solid #eee;border-bottom:1px solid #eee;padding: 10px 0px;margin: 0px 0px 10px;">

                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="asterisk">*</span>货品类型</label>
                                <div class="col-sm-4">

                                    <select class="form-control select_type " id="select_type" name="data[type_name_id]"
                                            required cname="货品类型"
                                            data-name="货品类型">
                                        <option value="" selected="selected">--请选择类型--</option>
                                    </select>
                                    <input type="hidden" name="data[type_name]">
                                </div>
                                <p class="help-block">

                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="asterisk">*</span>货品名称</label>
                                <div class="col-sm-4">

                                    <select class="form-control select_pro " id="select_pro"
                                            name="data[product_name_id]" required cname="货品名称"
                                            data-name="货品名称">
                                        <option value="" selected="selected">--请选择品名--</option>

                                    </select>
                                    <input type="hidden" name="data[product_name]">

                                </div>
                                <p class="help-block">

                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="asterisk">*</span>货品厂家</label>
                                <div class="col-sm-4">

                                    <select class="form-control select_fac " name="data[factory_name_id]" required
                                            cname="货品厂家" data-name="货品厂家">
                                        <option value="" selected="selected">--请选择厂家--</option>

                                    </select>
                                    <input type="hidden" name="data[factory_name]">

                                </div>
                                <p class="help-block">

                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="asterisk">*</span>货品牌号</label>
                                <div class="col-sm-4">

                                    <select class="form-control select_bra " name="data[brand_name_id]" required
                                            cname="货品牌号" data-name="货品牌号">
                                        <option value="" selected="selected">--请选择牌号--</option>

                                    </select>
                                    <input type="hidden" name="data[brand_name]">
                                    <input type="hidden" name="data[tpfb]">


                                </div>
                                <p class="help-block">

                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">质量等级 </label>
                                <div class="col-sm-4">

                                    <input dtype="" class="form-control"  name="data[level]"
                                           placeholder="质量等级"  cname="质量等级"data-name="质量等级" value="{$item[level]}"/>
                                    <label class="help-block"></label>

                                </div>

                            </div>
                        </div>

                        <!--tmpl-fields-->
                        <h4>商品属性</h4>
                        <div style="border-top:1px solid #eee;border-bottom:1px solid #eee;padding: 10px 0px;margin: 0px 0px 10px;">


                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span
                                        class="asterisk">*</span>货品规格（{$pro_std}）</label>
                                <div class="col-sm-4">

                                    <input dtype="number" type="text" class="form-control" maxlength="7"required cname="货品规格" name="data[pkg_size]"
                                           value="{$item[pkg_size]}"
                                           data-name="货品规格">
                                </div>
                                <p class="help-block"></p>

                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="asterisk">*</span>货号 </label>
                                <div class="col-sm-4">

                                    <input dtype="" class="form-control" maxlength="25" name="data[product_no]"
                                           placeholder="产品货号" cname="产品货号" data-name="产品货号" readonly="true" value="{$item[product_no]}"/>

                                </div>
                                <p class="help-block"></p>

                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">计价类型</label>
                                <div class="col-sm-4">
                                    {setRadioOptions $valuationTypeList data[valuation_type] $item['valuation_type']}

                                </div>
                                <p class="help-block"></p>

                            </div>


                            <!-- input -->
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="asterisk">*</span>数量(库存数量)({$pro_unit}) </label>
                                <div class="col-sm-4">

                                    <input dtype="number" class="form-control" maxlength="{maxlength}"
                                           name="data[quantity]"
                                           placeholder="数量(库存数量)" required cname="数量(库存数量)"data-name="数量(库存数量)" value="{$item[quantity]}"/>
                                </div>
                                <p class="help-block"></p>

                            </div>

                            <!-- input -->
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="asterisk">*</span>最小交易量({$pro_unit}) </label>
                                <div class="col-sm-4">

                                    <input dtype="number" class="form-control" maxlength="{maxlength}"
                                           name="data[min_volume]"
                                           placeholder="最小交易量" required cname="最小交易量" data-name="最小交易量" value="{$item[min_volume]}"/>
                                </div>
                                <p class="help-block"></p>

                            </div>

                            <!-- input -->
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="asterisk">*</span>销售价(元/{$pro_unit}) </label>
                                <div class="col-sm-4">
                                    <input dtype="number" class="form-control" maxlength="{maxlength}"
                                           name="data[sales_price]" placeholder="销售价" required cname="销售价" data-name="销售价"
                                           value="{$item[sales_price]}"/>
                                </div>
                                <p class="help-block"></p>

                            </div>

                            <!-- input -->
                            <div class="form-group">
                                <label class="col-sm-2 control-label">成本价(元/{$pro_unit}) </label>
                                <div class="col-sm-4">

                                    <input dtype="number" class="form-control" maxlength="{maxlength}"
                                           name="data[cost_price]"
                                           placeholder="成本价"  cname="成本价" data-name="成本价" value="{$item[cost_price]}"/>
                                </div>
                                <p class="help-block"></p>

                            </div>
                            <!-- input -->
                            <div class="form-group">
                                <label class="col-sm-2 control-label">货品介绍 </label>

                                <div class="col-sm-8">

                                    <textarea class="form-control editor"  style="width: 100%; height: 300px;"
                                              name="data[product_summary]" placeholder="货品介绍" cname="货品介绍" data-name="货品介绍">{$item[product_summary]}</textarea>
                                </div>

                                <div style="color:#f00">
                                    <span class="word_surplus"></span>
                                </div>

                                <p class="help-block"></p>

                            </div>
                        </div>
                        <h4>销售设置</h4>
                        <div style="border-top:1px solid #eee;border-bottom:1px solid #eee;padding: 10px 0px;margin: 0px 0px 10px;">


                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="asterisk">*</span>交收方式</label>
                                <div class="col-sm-4">
                                    {setRadioOptions $deliveryWayList data[delivery_way] $item['delivery_way']}
                                </div>

                            </div>

                            <div class="form-group">

                                <label class="col-sm-2 control-label"><span class="asterisk">*</span>交收仓库</label>
                                <div class="col-sm-4">
                                    {setSelectOptions $repertoryList data[repertory_id] $item['repertory_id'] '请选择仓库'
                                    'required cname="仓库" data-name="仓库"'}
                                </div>
                                <p class="help-block"></p>


                            </div>
                            <div id="repertory_info"></div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">发布方式</label>
                                <div class="col-sm-4">
                                    {setRadioOptions $publishWayList data[publish_way] $item['publish_way']}


                                    <input type="hidden" name="data[publish_way_is_members]" value="{$publish_way_is_members}">
                                    <table class="publish_way_is_members_name" style="border-top: 1px #ccc solid; margin-left: 17px;">

                                    </table>
                                </div>
                            </div>
                            <input type="hidden" name="data[member_sales_price]" value="{$item['member_sales_price']}">
                            <input type="hidden" name="data[member_delivery_way]" value="{$item['member_delivery_way']}">

                        </div>
                        <!--tmpl-assocfields-->
                        <div class="btn-group btn-group-or">
                            <button class="btn btn-primary">提交保存</button>
                        </div>
                    </form><!-- content add form -->
                </div>
            </div><!-- end of inner -->
        </section>
    </div>
</div>
{include admin.inc.footer}

<!--tmpl-script-->

<!-- pagescript -->
<script type="text/javascript">
    seajs.use("admin/productadd", function (parameter) {

        parameter.editor();

        parameter.upload_url = "{$upload_url}";
        parameter.image_search_url = "{$image_search_url}";
        parameter.image_list_url = "{$image_list_url}";
        parameter.success_return_link = "{$from}";

        parameter.tpfb = "{$item['tpfb']}";
        parameter.zNodes = {$groupMembers};

        parameter.initByEdit();


    });
</script>

<!--tmpl-script-->
<script id="publish_way_is_members" type="text/template">

    <div class="tab-content">
        <div style="float: left;width: 300px;border-right: 1px solid #ccc;">
            <div class="form-group input-group" style="padding:3px 9px;">
                <input type="text" name="input-tree-search" class="form-control" placeholder="会员"  cname="会员">
                <span class="input-group-btn">
                     <button class="btn btn-default btn-tree-search" type="button"><i class="glyphicon glyphicon-search"></i>
                     </button>
               </span>
            </div>
            <div class="zTreeDemoBackground left">
                <ul id="treeDemo" class="ztree"></ul>
            </div>
        </div>
        <form role="form" id="member_form" class="form-horizontal basicForm"
              autocomplete="off" onsubmit="return false">

          <div id="edit-add-box"
             style="float:right;width: 470px;overflow: hidden;margin: auto 1% auto auto;padding: 12px 5px;">
             <h5>所选会员</h5>
             <div id="checked_members" style="border-top:1px solid #eee;padding: 10px 0px;margin: 0px 0px 10px;">
             </div>
             <input type="hidden" id="checked_members_value" placeholder="指定会员" required cname="指定会员"
                   data-name="指定会员" />
             <p class="help-block"></p>

             <h5>销售设置</h5>
             <div style="border-top:1px solid #eee;border-bottom:1px solid #eee;padding: 10px 0px;margin: 0px 0px 10px;">


                    <div class="form-group">
                        <label class="col-sm-3 control-label" style="text-align: left"><span class="asterisk">*</span>销售价 </label>
                        <div class="col-sm-4">
                            <input dtype="number" class="form-control"
                                   name="member_sales_price" id="member_sales_price" placeholder="销售价" required
                                   data-name="销售价" value="{$item['member_sales_price']}"/>
                        </div>
                        <p class="help-block"></p>

                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label" style="text-align: left"><span class="asterisk">*</span>交收方式</label>
                        <div class="col-sm-4">
                            {setRadioOptions $deliveryWayList member_delivery_way $item['member_delivery_way']}
                        </div>
                    </div>

              </div>
          </div>
        </form>

    </div>
</script>
<script id="assocpage" type="text/html">
    <div class="text-right">
        <ul class="pagination blog-pagination">
            <li><a class="assoc-page" data-page="{[prev]}" href="javascript:void(0);">上一页</a></li>
            {[loop pages page]}

            <li><a class="assoc-page" data-page="{[page]}" {[if curr== page]}class="active" {[/if]}
                href="javascript:void(0)">{[page]}</a></li>

            {[/loop]}
            <li><a class="assoc-page" href="javascript:void(0);" data-page="{[nexts]}">下一页</a></li>
        </ul>
    </div>
</script>

</body>
</html>
